package cn.itcast.service.impl;

import cn.itcast.dao.AccountDao;
import cn.itcast.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountDao accountDao;


    @Override

    public void transfer(Integer from, Integer to, Double money) {
        accountDao.updateMoneyById(from,-money);
        System.out.println(1/0);
        accountDao.updateMoneyById(to,money);
    }
}
